#include "serialset.h"

#include <QIcon>
#include <QVBoxLayout>
#include <QPropertyAnimation>
#include <src/commom/stackstatuswidget.h>
#include <src/clean/common/cleanscanbottom.h>
#include <QDebug>
serialSet::serialSet(QWidget *parent) :
BaseStyleWidget(parent)
{
    this->initUI();
    initConnect();

}
void serialSet::initUI()
{
    this->setFixedSize(900, 600);
    this->setWindowIcon(QIcon(":/main/Logo"));
    this->setWindowTitle(tr("test"));
    m_stackStatusWidget = new StackStatusWidget;
    m_stackStatusWidget->setStaticIcon(":/safe/logo_normal");
    m_stackStatusWidget->setNormalButton(":/safe/start");
    m_stackStatusWidget->setTextInfo("奥瑞", "内部测试");
    m_topBackWidget = new WenliBackWidget;
    m_topBackWidget->insertWidget(m_stackStatusWidget);
    m_topBackWidget->setButtonInfo(":/safe/return");
    m_topBackWidget->setFixedHeight(150);//绿条的宽度


    m_serialPort = new serialPort;

    QGridLayout *vLayout = new QGridLayout;

//    vLayout->addWidget(m_topBackWidget,0, 0, 1, 2);
    vLayout->addWidget(m_serialPort, 1, 0, 2, 2); // (row, column, rowSpan, columnSpan)
//    vLayout->addWidget(m_axisTest2, 1, 1); // (row, column, rowSpan, columnSpan)
//    vLayout->addWidget(m_axisTest3, 2, 0); // (row, column, rowSpan, columnSpan)
//    vLayout->addWidget(m_axisTest4, 2, 1); // (row, column, rowSpan, columnSpan)

    vLayout->setSpacing(0);
    vLayout->setContentsMargins(0,0,0,0);
    this->setLayout(vLayout);

}

void serialSet::initConnect()
{
    connect(m_topBackWidget, SIGNAL(buttonClicked()), this, SIGNAL(goToMain()));
    connect(m_topBackWidget, SIGNAL(showMin()), this, SIGNAL(showMin()));
    connect(m_topBackWidget, SIGNAL(closeWidget()), this, SIGNAL(closeWidget()));
    connect(m_serialPort, &serialPort::mySignal, this, &serialSet::mySignal);
    connect(m_serialPort, &serialPort::mySignal2, this, &serialSet::mySignal2);
    connect(m_serialPort, &serialPort::mySignal3, this, &serialSet::mySignal3);
    connect(m_serialPort, &serialPort::mySignal4, this, &serialSet::mySignal4);
    connect(m_serialPort, &serialPort::mySignal5, this, &serialSet::mySignal5);
    connect(m_serialPort, &serialPort::mySignal6, this, &serialSet::mySignal6);
    connect(m_serialPort, &serialPort::mySignal7, this, &serialSet::mySignal7);
    connect(m_serialPort, &serialPort::mySignal8, this, &serialSet::mySignal8);
    connect(m_serialPort, &serialPort::mySignal9, this, &serialSet::mySignal9);
    connect(m_serialPort, &serialPort::mySignal10, this, &serialSet::mySignal10);


}

void serialSet::onMySignal(double value)
{

}
void serialSet::onMySignal2(double value)
{

}
